import org.kwis.msp.lcdui.*;

public class ScreenManager extends Card{

	public final static int RED=0x00FF0000;
    public final static int GREEN=0x0000FF00;
    public final static int BLUE=0x000000FF;
    public final static int WHITE=0x00FFFFFF;
    public final static int BLACK=0x00000000;
    public final static int GREY=0X00808080;
    public final static int YELLOW=0X00808080;



	private boolean titleScreen = true;

	public ScreenManager(){
		
	}// ScreenManager Constructor

		
//------------  paint() ---------------		

		public void paint(Graphics g){

			if(titleScreen){
				paintTitleScreen(g);
			}//if
			else{
				paintBattleField(g);
			}

		}//paint()

//-----------  paintTitleScreen()  ----------

		public void paintTitleScreen(Graphics g){

			Image imgTitle= null;
			Image imgTitleLatter = null;


			g.setColor(GREY);
			g.fillRect(0, 0, getWidth(), getHeight());

			try{
				imgTitle= Image.createImage("/InvaderMain.bmp");
				imgTitleLatter= Image.createImage("/InvaderLatter.png");
			}catch(Exception e){}

			g.drawImage(imgTitle , getWidth()/2, 60, Graphics.HCENTER);
			g.drawImage(imgTitleLatter,getWidth()/2, 20, Graphics.HCENTER);
		
		} //paintTieleScreen()

//-----------  paintBattleField()  ---------------

		public void paintBattleField(Graphics g){
			g.setColor(BLACK);
			g.fillRect(0, 0, getWidth(), getHeight());

		
		}//paintBattleField()

//------------  keyNotify()  ---------------------

		protected boolean keyNotify(int type, int key){
			if(titleScreen){
				titleScreen = false;
				repaint();
				return true;
			}//if
		
			return true;
		} // keyNotify()


	}//Class ScreenManager
